home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
19
/
madtrb40.zip
/
PROLDR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-05-20
|
3KB
|
109 lines
Program ProLdr; { Loads a font file into the RAM area of IBM Proprinter. }
Const
MaxChar = 94;
MinChar = 1;
Type
Fontype = array[0..11] of integer;
Filetype = file of fontype;
Str255 = String[255];
Str80 = String[80];
Str4 = array[1..4] of char;
Var
Font : array[1..MaxChar] of Fontype;
Fontfile : Filetype;
ColNum : Integer;
Error : Str80;
Ans : Integer;
Extension : Str4;
Count1,Count2 : integer;
c1,c2,CopyNum,PrtNum : integer;
CharNum : integer;
MaxCopy : integer;
Attribute : integer;
{$I Beep.inc }
{$I Answer.inc }
{$I Files.inc }
{$I DirExt.inc }
Begin
Error := 'O';
Extension[1] := '.';
Extension[2] := 'F';
Extension[3] := 'N';
Extension[4] := 'T';
writeln('EPSON font file loader. by C.A. Rinehart (c) 1986');
writeln(' Present font file names are: ');
ListDirectory;
writeln;
writeln('Copy characters from disk font file to printer.');
repeat
Error := 'O';
OpenFile(FontFile,Error,Extension);
If Error <> '' then
begin
writeln(Error);
write('Try another file? (Y/N) ');
Answer('yes,no',Ans,false);
writeln;
end;
until (Ans = 2) or (Error = '');
CharNum := MinChar;
if Error = '' then
begin
repeat
write('Enter first character # to be copied. ');
readln(c1);
write('Enter last character # to be copied. ');
readln(c2);
write('Enter first character # to which the characters will be copied. ');
readln(PrtNum);
until (c2 >= c1) and (PrtNum in [MinChar..MaxChar]) and (c2 in [MinChar..MaxChar]);
seek(FontFile,c1);
CopyNum := c2-c1;
MaxCopy := CopyNum;
Count1 := CopyNum * 13 + 2;
Count2 := 0;
if CopyNum = MaxChar then
begin
Count1 := 200;
Count2 := 4;
end;
while (NOT EOF(FontFile)) and (CharNum <= MaxChar) and (CopyNum >= 0) do
begin
read(fontfile, font[CharNum]);
CharNum := CharNum + 1;
CopyNum := CopyNum - 1;
end;
end
else
begin
writeln;
writeln('No characters read from file!');
beep(1);
delay(2000);
end;
CloseFile(FontFile, Error);
if Error <> '' then
begin
writeln('Close file error:');
writeln(Error);
beep(1);
delay(2000);
end;
write(Lst,chr(27),'=',chr(count1),chr(count2),chr(20),chr(PrtNum));
for CharNum := 1 to MaxCopy do
begin
if font[charnum,0] >= 128 then
attribute := 1
else
attribute := 0;
write(Lst,chr(attribute), chr(0));
for ColNum := 1 to 11 do
write(Lst,chr(font[CharNum,ColNum]));
end;
end.